﻿@{
    Layout = null;
    ViewBag.Title = "PhraseManagementEdit";
}

                      
@model ElingOA6_Admin_DSJCJ.Model.SysPhrase

<!DOCTYPE html>
<html>
<head>
    @if (false)
    {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
    }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/regex.js", true)" type="text/javascript"></script>
    <script src="@Url.Content("~/Scripts/PageCommon.js", true)" type="text/javascript"></script>

    @Html.DevExpress().GetStyleSheets(
        new StyleSheet { ExtensionType = ExtensionType.ListBox }
    )
    @Html.DevExpress().GetScripts(
         new Script { ExtensionType = ExtensionType.ListBox }
    )
        @Html.DevExpress().GetStyleSheets(

        new StyleSheet { ExtensionType = ExtensionType.ListBox, Theme = DevExpressHelper.Theme },
        new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }
)


<script>
    //点击确定

    // 提示
//    function pd(codeName, phrase, url, deptName,emplName) {
//        var bl = true;

//        if (null == codeName || ASPxClientUtils.Trim(codeName) == "") {
//            tbCodeName.SetErrorText("请选择类别");
//            tbCodeName.SetIsValid(false);
//            bl = false;
//        }
//        if (null == phrase || ASPxClientUtils.Trim(phrase) == "") {
//            tbPhrase.SetErrorText("请填写内容");
//            tbPhrase.SetIsValid(false);
//            bl = false;
//        }
//        if (null == url || ASPxClientUtils.Trim(url) == "") {
//            tbUrl.SetErrorText("请填写url");
//            tbUrl.SetIsValid(false);
//            bl = false;
//        }
//        if (null == deptName || ASPxClientUtils.Trim(deptName) == "") {
//            tbDeptName.SetErrorText("请填写部门名称");
//            tbDeptName.SetIsValid(false);
//            bl = false;
//        }
//        if (null == emplName || ASPxClientUtils.Trim(emplName) == "") {
//            tbEmplName.SetErrorText("请填写发布人员");
//            tbEmplName.SetIsValid(false);
//            bl = false;
//        }
//        if (null == pubDate || ASPxClientUtils.Trim(pubDate) == "") {
//            tbPubDate.SetErrorText("请填写发布日期");
//            tbPubDate.SetIsValid(false);
//            bl = false;
//        }
//        return bl;
    //    }
    $(document).ready(function () {
        var hdjsAlert = $("#hdjsAlert").val();
        if (hdjsAlert == "OK") {
            alert("操作成功");
            parent.window.location.href = rootPath + "/Admin/PhraseManagement";
        }
        else if (hdjsAlert == "error") {
            alert("操作失败");
        }
    });

    function OK() {
        form1.submit();
     }


</script>
</head>

<body>
    @using (Html.BeginForm("Save", "PhraseManagement", FormMethod.Post, new { id = "form1", @class = "tableFrom" }))
    {
    <table class="tableForm">
             <tr>
                <th>
                    类别：</th>
                <td class="tdClass">
                @Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "FPhraseNo";
                    settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                    settings.Properties.TextField = "FCodeName";
                    settings.Properties.ValueField = "FCodeNo";
                    settings.SelectedIndex = 0;

                }).BindList(ViewData["SYS_PHRSList"]).Bind(Model.FPhraseNo).GetHtml()
                </td>
            </tr>

            <tr>
                <th>
                    置顶：</th>
                <td class="tdClass">
                @Html.DevExpress().CheckBox(settings =>
                {
                    settings.Name = "FIsTop";
                    settings.Text = "置顶";
                    if (Model.FIsTop == 1)
                    {
                        settings.Checked = true;
                    }
                    else
                    {
                        settings.Checked = false;
                    }
                }).GetHtml()
                </td>
            </tr>
            <tr>
                <th>
                    内容：</th>
                <td class="tdClass">
                    @Html.DevExpress().Memo(settings =>
                    {
                        settings.Name = "FPhrase";
                        settings.Width = 570;
                        settings.Text = Model.FPhrase;
                    }).GetHtml()
                    </td>

</tr>
            <tr>
            <th>URL：</th>
                <td  class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
                    {
                        settings.Name = "FURL";
                        settings.Width = 570;
                        settings.Text = Model.FURL;
                    }).GetHtml()</td>
            </tr>
            <tr>
                <th>
                    部门名称：</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "tbDeptName";
               settings.Text = ViewData["DeptName"].ToString();
               settings.Width = 570;
               settings.Enabled = false;
           }).GetHtml()
                 </td>
              </tr>
              <tr>
                <th>
                    发布人员：</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "tbEmplName";
               settings.Text = Model.FEmpName;
               settings.Width = 570;
               settings.Properties.ValidationSettings.EnableCustomValidation = true;
               settings.Enabled = false;
           }).GetHtml()
                    
                </td>
                </tr>

                <tr>
                <th>
                    发布日期：</th>
                <td class="tdClass">
                    @Html.DevExpress().TextBox(settings =>
           {
               settings.Name = "tbPubDate";
               settings.Text = Model.PubDateString;
               settings.Width = 570;
               settings.Enabled = false;
           }).GetHtml()
                </td>
            </tr>
    </table>
        
        @Html.Hidden("hdMethod", ViewData["hdMethod"]);
        @Html.Hidden("hdjsAlert", (ViewData["jsAlert"]));                                             
        @Html.Hidden("hdphraseNo", (ViewData["phraseNo"]));  
        @Html.Hidden("FEmplNo", Model.FEmplNo);  
    }

</body>
</html>